package com.share.wechat.order.entity;

import com.share.wechat.core.entity.Detail;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;
import java.util.List;

/**
 * 订单的实体类
 */
@Entity
@Table(name = "WEB_PRD_SALES_ORDER")
public class SalesOrder {
    /**
     * id
     */
    @Id
    private String id;
    /**
     * 用户信息
     */
    private String userInfo;
    /**
     * 订单所有的价格
     */
    private Double totalMoney;

    /**
     * 购买商品集合
     */
    @Transient
    private List<Detail> salesDetail;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 更新时间
     */
    private Date updateTime;
    /**
     * 订单的有效性
     */
    private int isValid;
    /**
     * 订单的支付状态
     */
    private int isPay;
    /**
     * 订单的销毁时间
     * 完成支付或者过期都为销毁状态
     */
    private Date destroyTime;
    /**
     * 订单的支付时间
     */
    private Date payTime;

    /**
     * 完成订单支付人
     */
    private String payUserInfo;

    /**
     * 支付流水号
     */
    private String serialNumber;
    /**
     * 支付方式
     */
    private int payWay;
    /**
     * 该订单的实体类
     */
    private int totalNum;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUserInfo() {
        return userInfo;
    }

    public void setUserInfo(String userInfo) {
        this.userInfo = userInfo;
    }

    public Double getTotalMoney() {
        return totalMoney;
    }

    public void setTotalMoney(Double totalMoney) {
        this.totalMoney = totalMoney;
    }

    public List<Detail> getSalesDetail() {
        return salesDetail;
    }

    public void setSalesDetail(List<Detail> salesDetail) {
        this.salesDetail = salesDetail;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public int getIsValid() {
        return isValid;
    }

    public void setIsValid(int isValid) {
        this.isValid = isValid;
    }

    public int getIsPay() {
        return isPay;
    }

    public void setIsPay(int isPay) {
        this.isPay = isPay;
    }

    public Date getDestroyTime() {
        return destroyTime;
    }

    public void setDestroyTime(Date destroyTime) {
        this.destroyTime = destroyTime;
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    public String getPayUserInfo() {
        return payUserInfo;
    }

    public void setPayUserInfo(String payUserInfo) {
        this.payUserInfo = payUserInfo;
    }

    public String getSerialNumber() {
        return serialNumber;
    }

    public void setSerialNumber(String serialNumber) {
        this.serialNumber = serialNumber;
    }

    public int getPayWay() {
        return payWay;
    }

    public void setPayWay(int payWay) {
        this.payWay = payWay;
    }

    public int getTotalNum() {
        return totalNum;
    }

    public void setTotalNum(int totalNum) {
        this.totalNum = totalNum;
    }

    @Override
    public String toString() {
        return "SalesOrder{" +
                "id='" + id + '\'' +
                ", userInfo='" + userInfo + '\'' +
                ", totalMoney=" + totalMoney +
                ", salesDetail=" + salesDetail +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", isValid=" + isValid +
                ", isPay=" + isPay +
                ", destroyTime=" + destroyTime +
                ", payTime=" + payTime +
                ", payUserInfo='" + payUserInfo + '\'' +
                ", serialNumber='" + serialNumber + '\'' +
                ", payWay='" + payWay + '\'' +
                ", totalNum=" + totalNum +
                '}';
    }
}
